import axios from '@/libs/api.request'

/**
 * 商品管理
 */

// 商品分类列表
export const getGoodsClassList = (data) => {
  return axios.request({
    url: 'GoodsClass/GetPageList',
    method: 'post',
    data
  })
}
// 获取商品分类详情
export const getGoodsClassDetail = (data) => {
  return axios.request({
    url: 'GoodsClass/GetModel',
    method: 'post',
    data
  })
}
// 编辑/添加商品分类
export const editGoodsClass = (data) => {
  return axios.request({
    url: 'GoodsClass/UpdateModel',
    method: 'post',
    data
  })
}

// 商品属性列表
export const getGoodsAttrList = (data) => {
  return axios.request({
    url: 'GoodsKey/GetPageList',
    method: 'post',
    data
  })
}
// 获取商品属性详情
export const getGoodsAttrDetail = (data) => {
  return axios.request({
    url: 'GoodsKey/GetModel',
    method: 'post',
    data
  })
}
// 编辑/新增商品属性详情
export const editGoodsAttrDetail = (data) => {
  return axios.request({
    url: 'GoodsKey/UpdateModel',
    method: 'post',
    data
  })
}

// 获取商品列表
export const getGoodsList = (data) => {
  return axios.request({
    url: 'Product/GetPageList',
    method: 'post',
    data
  })
}
// 获取商品详情
export const getGoodsDetail = (data) => {
  return axios.request({
    url: 'Product/GetModel',
    method: 'post',
    data
  })
}
// 新增/编辑商品详情
export const editGoodsDetail = (data) => {
  return axios.request({
    url: 'Product/EditMode',
    method: 'post',
    data
  })
}
// 删除商品
export const delGoods = (data) => {
  return axios.request({
    url: 'Product/Delete',
    method: 'post',
    data
  })
}

// 获取商品评论列表
export const getGoodsCommentList = (data) => {
  return axios.request({
    url: 'ProductComment/GetPageList',
    method: 'post',
    data
  })
}
